<template>
  <view>
    <h1 style="text-align: center; margin-bottom: 20px;">南京市魔方运动协会教练证考核表</h1>
	<view class="uni-container">
    <uni-table  border stripe emptyText="暂无更多数据" >
        <uni-tr >
          <uni-th width="20px">考核日期</uni-th>
          <uni-th width="20px">姓名</uni-th>
          <uni-th width="20px">性别</uni-th>
          <uni-th width="20px">证书编号</uni-th>
          <uni-th width="20px">考核结果</uni-th>
        </uni-tr>
        <uni-tr v-for="item in datalist" :key="item.id" >
          <uni-td >{{ item.assess_date }}</uni-td>
          <uni-td >{{ item.name }} </uni-td>
          <uni-td >{{ item.gender }} </uni-td>
          <uni-td >{{ item.certificate_id }} </uni-td>
          <uni-td >{{ item.assess_result }} </uni-td>
        </uni-tr>
    </uni-table>
	</view>
  </view>
</template>

<script>
	export default {
		data() {
			return {
				datalist: [],
			}
		},		
		onLoad() {
			this.getCertificate()
		},
		methods: {
			getCertificate(){
				uni.showLoading({
					title: '加载中'
				});
				uniCloud.callFunction({
					name: 'pagefunction',
					data: {
						dbName: 'certificate', //要查询的表名
						filter: {}, //筛选条件，格式{sex:'女'}
						pageIndex: this.pageIndex, //第几页
						pageSize: 30 //每页的记录条数
					},
					success: res => {
						this.datalist = res.result.data;
						console.log(res.result)
						uni.hideLoading();
					}
				})
			},
		}
	}
</script>

<style>
</style>
